package com.baibei.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * 首页商品一行数据
 * Created by air on 18/4/18.
 */

public class HomeIndexProductInfo implements Parcelable {
    private List<ProductInfo> child;

    private String area;

    private String saleTips;

    private QuotationProductInfo parent;

    private String brandName;

    private int brandId;

    public List<ProductInfo> getChild() {
        return child;
    }

    public void setChild(List<ProductInfo> child) {
        this.child = child;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public String getSaleTips() {
        return saleTips;
    }

    public void setSaleTips(String saleTips) {
        this.saleTips = saleTips;
    }

    public QuotationProductInfo getParent() {
        return parent;
    }

    public void setParent(QuotationProductInfo parent) {
        this.parent = parent;
    }

    public String getBrandName() {
        return brandName;
    }

    public void setBrandName(String brandName) {
        this.brandName = brandName;
    }

    public int getBrandId() {
        return brandId;
    }

    public void setBrandId(int brandId) {
        this.brandId = brandId;
    }

    @Override
    public String toString() {
        return "HomeIndexProductInfo{" +
                "child=" + child +
                ", area='" + area + '\'' +
                ", saleTips='" + saleTips + '\'' +
                ", parent=" + parent +
                ", brandName='" + brandName + '\'' +
                ", brandId=" + brandId +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeTypedList(this.child);
        dest.writeString(this.area);
        dest.writeString(this.saleTips);
        dest.writeParcelable(this.parent, flags);
        dest.writeString(this.brandName);
        dest.writeInt(this.brandId);
    }

    public HomeIndexProductInfo() {
    }

    protected HomeIndexProductInfo(Parcel in) {
        this.child = in.createTypedArrayList(ProductInfo.CREATOR);
        this.area = in.readString();
        this.saleTips = in.readString();
        this.parent = in.readParcelable(ProductInfo.class.getClassLoader());
        this.brandName = in.readString();
        this.brandId = in.readInt();
    }

    public static final Creator<HomeIndexProductInfo> CREATOR = new Creator<HomeIndexProductInfo>() {
        @Override
        public HomeIndexProductInfo createFromParcel(Parcel source) {
            return new HomeIndexProductInfo(source);
        }

        @Override
        public HomeIndexProductInfo[] newArray(int size) {
            return new HomeIndexProductInfo[size];
        }
    };
}
